Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apollo/usage-reporting-protobuf

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo/usage-reporting-protobuf

Protobuf format for Apollo usage reporting

  • 4.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is @apollo/usage-reporting-protobuf?

@apollo/usage-reporting-protobuf is a package that provides Protocol Buffers (protobuf) definitions and utilities for usage reporting in Apollo GraphQL. It is used to serialize and deserialize data related to GraphQL usage reporting, which can be sent to Apollo's usage reporting endpoint.

What are @apollo/usage-reporting-protobuf's main functionalities?

Serialization

This feature allows you to create a report object and serialize it into a binary format using Protocol Buffers. The serialized data can then be sent to Apollo's usage reporting endpoint.

const { Report } = require('@apollo/usage-reporting-protobuf');
const report = Report.create({ /* report data */ });
const buffer = Report.encode(report).finish();
console.log(buffer);

Deserialization

This feature allows you to deserialize binary data back into a report object. This is useful for processing usage reports received from Apollo's usage reporting endpoint.

const { Report } = require('@apollo/usage-reporting-protobuf');
const buffer = /* some binary data */;
const report = Report.decode(buffer);
console.log(report);

Validation

This feature allows you to validate a report object to ensure it conforms to the expected schema. This helps in catching errors before serialization or deserialization.

const { Report } = require('@apollo/usage-reporting-protobuf');
const report = Report.create({ /* report data */ });
const errMsg = Report.verify(report);
if (errMsg) throw Error(errMsg);

Other packages similar to @apollo/usage-reporting-protobuf

Keywords

FAQs

Package last updated on 26 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc